home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / tpapi.exe / EXAMPLES / ULIST.PAS < prev    next >
Pascal/Delphi Source File  |  1994-01-14  |  4KB  |  96 lines

  1. {***************************************************************************}
  2. {** Program : ULIST                                                       **}
  3. {***************************************************************************}
  4. {** Version : 1.0             ** Started :           ** Ended :           **}
  5. {***************************************************************************}
  6. {******************************** Description ******************************}
  7. {***************************************************************************}
  8. {** This will display a simple userlist like the Novell utility USERLIST  **}
  9. {**                                                                       **}
  10. {** I haven't taken to much time sorting out the columns as this is only  **}
  11. {** an example of the Netware API's.                                      **}
  12. {**                                                                       **}
  13. {**                                                                       **}
  14. {**                                                                       **}
  15. {**                                                                       **}
  16. {***************************************************************************}
  17. {******************************** Information ******************************}
  18. {***************************************************************************}
  19. {**                                                                       **}
  20. {**                                                                       **}
  21. {**                                                                       **}
  22. {**                                                                       **}
  23. {***************************************************************************}
  24.  
  25. {$X+}
  26.  
  27. { $DEFINE OPRO} {define this to use OPRO date/time formatting routines}
  28.  
  29. program CAPLPT;
  30.  
  31. uses
  32.  
  33.   crt,
  34.   {$IFDEF OPRO}
  35.   opdate,
  36.   {$ENDIF}
  37.   nwvar,
  38.   nwerror,
  39.   nwconn,
  40.   nwfsserv;
  41.  
  42. var
  43.  
  44.   Connection  : ConnectionOBJ;
  45.   FileServer  : FileServerOBJ;
  46.   FSInfo      : File_Serv_Info;
  47.   ObjectName  : TObjectName;
  48.   ObjectType  : OT_BinderyType;
  49.   ObjectID    : OT_BinderyID;
  50.   LoginTime   : TByte7Array;
  51.   Counter     : word;
  52.  
  53. begin
  54.  
  55.   clrscr;
  56.   Connection.Init (true);
  57.   FileServer.Init (true);
  58.   with Connection, FileServer do
  59.     begin
  60.  
  61.       if GetFileServerInformation (FSInfo) = SUCCESSFUL then
  62.         begin
  63.  
  64.           writeln;
  65.           writeln ('User Information for Server ', FSInfo.ServerName);
  66.           writeln ('Connection  User Name       Login Time');
  67.           writeln ('----------  --------------  -------------------');
  68.           for Counter := 1 to FSInfo.MaxConnectionsSupported do
  69.             begin
  70.  
  71.               GetConnectionInformation (Counter, ObjectName, ObjectType,
  72.                                         ObjectID, LoginTime);
  73.  
  74.               if ObjectName <> '' then
  75.                 begin
  76.  
  77.                   write (' ':3,Counter:3, ' ':6, ObjectName:5, ' ':6,
  78.                          LoginTime [2], '-', LoginTime [1], '-', LoginTime [0]);
  79.                   {$IFDEF OPRO}
  80.                   writeln (' ':2, TimeToAmPmString ('hh:mm te', HMStoTime (LoginTime [3], LoginTime [4], LoginTime [5])));
  81.                   {$ELSE}
  82.                   writeln;
  83.                   {$ENDIF}
  84.  
  85.                 end;
  86.  
  87.             end;
  88.  
  89.         end;
  90.  
  91.     end;
  92.  
  93.   FileServer.Done;
  94.   Connection.Done;
  95.  
  96. end.